import pandas as pd

# read in data
meta = pd.read_csv('../../data/metadata/stool/stool_metadata.csv', index_col=0)
titer_data = pd.read_csv('../../data/vaccine_response/vaccine_response_y1.tsv', sep='\t', index_col=0)
titer_data.index = [int(i.split('Baby')[-1]) for i in titer_data.index]

# get per sample titer levels
stool_titer_data = pd.DataFrame({sample: titer_data.loc[row['BabyN']] for sample, row in meta.iterrows() if row['BabyN'] in titer_data.index}).transpose()
stool_titer_data.to_csv('../../data/metadata/stool/stool_titers_yr1.csv', index_label='SampleID')
